package system

import (
	"encoding/json"
	"github.com/gin-gonic/gin"
	"github.com/sonhineboy/gsadmin/service/app/event"
	"github.com/sonhineboy/gsadmin/service/app/models"
	"github.com/sonhineboy/gsadmin/service/global"
	"net/http"
)

func Demo(c *gin.Context) {
	art := models.Article{}
	global.Db.First(&art)
	_ = global.EventDispatcher.Dispatch(event.NewTestEvent("asdfasoflasj"))
	c.JSON(http.StatusOK, gin.H{
		"code":     "22",
		"messages": "demo",
		"data":     art,
	})
}

func Menu(c *gin.Context) {
	menu := "{\n    \"code\":200,\n    \"data\":{\n        \"menu\":[\n            {\n                \"name\":\"home\",\n                \"path\":\"/home\",\n                \"meta\":{\n                    \"title\":\"首页\",\n                    \"icon\":\"el-icon-eleme-filled\",\n                    \"type\":\"menu\"\n                },\n                \"children\":[\n                    {\n                        \"name\":\"dashboard\",\n                        \"path\":\"/dashboard\",\n                        \"meta\":{\n                            \"title\":\"控制台\",\n                            \"icon\":\"el-icon-menu\",\n                            \"affix\":true\n                        },\n                        \"component\":\"home\"\n                    },\n                    {\n                        \"name\":\"userCenter\",\n                        \"path\":\"/usercenter\",\n                        \"meta\":{\n                            \"title\":\"帐号信息\",\n                            \"icon\":\"el-icon-user\",\n                            \"tag\":\"NEW\"\n                        },\n                        \"component\":\"userCenter\"\n                    }\n                ]\n            },\n            {\n                \"name\":\"vab\",\n                \"path\":\"/vab\",\n                \"meta\":{\n                    \"title\":\"组件\",\n                    \"icon\":\"el-icon-takeaway-box\",\n                    \"type\":\"menu\"\n                },\n                \"children\":[\n                    {\n                        \"path\":\"/vab/mini\",\n                        \"name\":\"minivab\",\n                        \"meta\":{\n                            \"title\":\"原子组件\",\n                            \"icon\":\"el-icon-magic-stick\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"vab/mini\"\n                    },\n                    {\n                        \"path\":\"/vab/iconfont\",\n                        \"name\":\"iconfont\",\n                        \"meta\":{\n                            \"title\":\"扩展图标\",\n                            \"icon\":\"el-icon-orange\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"vab/iconfont\"\n                    },\n                    {\n                        \"path\":\"/vab/data\",\n                        \"name\":\"vabdata\",\n                        \"meta\":{\n                            \"title\":\"Data 数据展示\",\n                            \"icon\":\"el-icon-histogram\",\n                            \"type\":\"menu\"\n                        },\n                        \"children\":[\n                            {\n                                \"path\":\"/vab/chart\",\n                                \"name\":\"chart\",\n                                \"meta\":{\n                                    \"title\":\"图表 Echarts\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/chart\"\n                            },\n                            {\n                                \"path\":\"/vab/statistic\",\n                                \"name\":\"statistic\",\n                                \"meta\":{\n                                    \"title\":\"统计数值\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/statistic\"\n                            },\n                            {\n                                \"path\":\"/vab/video\",\n                                \"name\":\"scvideo\",\n                                \"meta\":{\n                                    \"title\":\"视频播放器\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/video\"\n                            },\n                            {\n                                \"path\":\"/vab/qrcode\",\n                                \"name\":\"qrcode\",\n                                \"meta\":{\n                                    \"title\":\"二维码\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/qrcode\"\n                            }\n                        ]\n                    },\n                    {\n                        \"path\":\"/vab/form\",\n                        \"name\":\"vabform\",\n                        \"meta\":{\n                            \"title\":\"Form 数据录入\",\n                            \"icon\":\"el-icon-edit\",\n                            \"type\":\"menu\"\n                        },\n                        \"children\":[\n                            {\n                                \"path\":\"/vab/tableselect\",\n                                \"name\":\"tableselect\",\n                                \"meta\":{\n                                    \"title\":\"表格选择器\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/tableselect\"\n                            },\n                            {\n                                \"path\":\"/vab/formtable\",\n                                \"name\":\"formtable\",\n                                \"meta\":{\n                                    \"title\":\"表单表格\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/formtable\"\n                            },\n                            {\n                                \"path\":\"/vab/selectFilter\",\n                                \"name\":\"selectFilter\",\n                                \"meta\":{\n                                    \"title\":\"分类筛选器\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/selectFilter\"\n                            },\n                            {\n                                \"path\":\"/vab/filterbar\",\n                                \"name\":\"filterBar\",\n                                \"meta\":{\n                                    \"title\":\"过滤器v2\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/filterBar\"\n                            },\n                            {\n                                \"path\":\"/vab/upload\",\n                                \"name\":\"upload\",\n                                \"meta\":{\n                                    \"title\":\"上传\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/upload\"\n                            },\n                            {\n                                \"path\":\"/vab/select\",\n                                \"name\":\"scselect\",\n                                \"meta\":{\n                                    \"title\":\"异步选择器\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/select\"\n                            },\n                            {\n                                \"path\":\"/vab/iconselect\",\n                                \"name\":\"iconSelect\",\n                                \"meta\":{\n                                    \"title\":\"图标选择器\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/iconselect\"\n                            },\n                            {\n                                \"path\":\"/vab/cron\",\n                                \"name\":\"cron\",\n                                \"meta\":{\n                                    \"title\":\"Cron规则生成器\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/cron\"\n                            },\n                            {\n                                \"path\":\"/vab/editor\",\n                                \"name\":\"editor\",\n                                \"meta\":{\n                                    \"title\":\"富文本编辑器\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/editor\"\n                            },\n                            {\n                                \"path\":\"/vab/codeeditor\",\n                                \"name\":\"codeeditor\",\n                                \"meta\":{\n                                    \"title\":\"代码编辑器\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/codeeditor\"\n                            }\n                        ]\n                    },\n                    {\n                        \"path\":\"/vab/feedback\",\n                        \"name\":\"vabfeedback\",\n                        \"meta\":{\n                            \"title\":\"Feedback 反馈\",\n                            \"icon\":\"el-icon-mouse\",\n                            \"type\":\"menu\"\n                        },\n                        \"children\":[\n                            {\n                                \"path\":\"/vab/drag\",\n                                \"name\":\"drag\",\n                                \"meta\":{\n                                    \"title\":\"拖拽排序\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/drag\"\n                            },\n                            {\n                                \"path\":\"/vab/contextmenu\",\n                                \"name\":\"contextmenu\",\n                                \"meta\":{\n                                    \"title\":\"右键菜单\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/contextmenu\"\n                            },\n                            {\n                                \"path\":\"/vab/cropper\",\n                                \"name\":\"cropper\",\n                                \"meta\":{\n                                    \"title\":\"图像剪裁\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/cropper\"\n                            },\n                            {\n                                \"path\":\"/vab/fileselect\",\n                                \"name\":\"fileselect\",\n                                \"meta\":{\n                                    \"title\":\"资源库选择器(弃用)\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/fileselect\"\n                            },\n                            {\n                                \"path\":\"/vab/dialog\",\n                                \"name\":\"dialogExtend\",\n                                \"meta\":{\n                                    \"title\":\"弹窗扩展\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/dialog\"\n                            }\n                        ]\n                    },\n                    {\n                        \"path\":\"/vab/others\",\n                        \"name\":\"vabothers\",\n                        \"meta\":{\n                            \"title\":\"Others 其他\",\n                            \"icon\":\"el-icon-more-filled\",\n                            \"type\":\"menu\"\n                        },\n                        \"children\":[\n                            {\n                                \"path\":\"/vab/print\",\n                                \"name\":\"print\",\n                                \"meta\":{\n                                    \"title\":\"打印\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/print\"\n                            },\n                            {\n                                \"path\":\"/vab/watermark\",\n                                \"name\":\"watermark\",\n                                \"meta\":{\n                                    \"title\":\"水印\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/watermark\"\n                            },\n                            {\n                                \"path\":\"/vab/importexport\",\n                                \"name\":\"importexport\",\n                                \"meta\":{\n                                    \"title\":\"文件导出导入\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/importexport\"\n                            }\n                        ]\n                    },\n                    {\n                        \"path\":\"/vab/list\",\n                        \"name\":\"list\",\n                        \"meta\":{\n                            \"title\":\"Table 数据列表\",\n                            \"icon\":\"el-icon-fold\",\n                            \"type\":\"menu\"\n                        },\n                        \"children\":[\n                            {\n                                \"path\":\"/vab/table/base\",\n                                \"name\":\"tableBase\",\n                                \"meta\":{\n                                    \"title\":\"基础数据列表\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/table/base\"\n                            },\n                            {\n                                \"path\":\"/vab/table/thead\",\n                                \"name\":\"tableThead\",\n                                \"meta\":{\n                                    \"title\":\"多级表头\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/table/thead\"\n                            },\n                            {\n                                \"path\":\"/vab/table/column\",\n                                \"name\":\"tableCustomColumn\",\n                                \"meta\":{\n                                    \"title\":\"动态列\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/table/column\"\n                            },\n                            {\n                                \"path\":\"/vab/table/remote\",\n                                \"name\":\"tableRemote\",\n                                \"meta\":{\n                                    \"title\":\"远程排序过滤\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"vab/table/remote\"\n                            }\n                        ]\n                    },\n                    {\n                        \"path\":\"/vab/workflow\",\n                        \"name\":\"workflow\",\n                        \"meta\":{\n                            \"title\":\"工作流设计器\",\n                            \"icon\":\"el-icon-share\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"vab/workflow\"\n                    },\n                    {\n                        \"path\":\"/vab/formrender\",\n                        \"name\":\"formRender\",\n                        \"meta\":{\n                            \"title\":\"动态表单(Beta)\",\n                            \"icon\":\"el-icon-message-box\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"vab/form\"\n                    }\n                ]\n            },\n            {\n                \"name\":\"template\",\n                \"path\":\"/template\",\n                \"meta\":{\n                    \"title\":\"模板\",\n                    \"icon\":\"el-icon-files\",\n                    \"type\":\"menu\"\n                },\n                \"children\":[\n                    {\n                        \"path\":\"/template/layout\",\n                        \"name\":\"layoutTemplate\",\n                        \"meta\":{\n                            \"title\":\"布局\",\n                            \"icon\":\"el-icon-grid\",\n                            \"type\":\"menu\"\n                        },\n                        \"children\":[\n                            {\n                                \"path\":\"/template/layout/blank\",\n                                \"name\":\"blank\",\n                                \"meta\":{\n                                    \"title\":\"空白模板\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"template/layout/blank\"\n                            },\n                            {\n                                \"path\":\"/template/layout/layoutTCB\",\n                                \"name\":\"layoutTCB\",\n                                \"meta\":{\n                                    \"title\":\"上中下布局\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"template/layout/layoutTCB\"\n                            },\n                            {\n                                \"path\":\"/template/layout/layoutLCR\",\n                                \"name\":\"layoutLCR\",\n                                \"meta\":{\n                                    \"title\":\"左中右布局\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"template/layout/layoutLCR\"\n                            }\n                        ]\n                    },\n                    {\n                        \"path\":\"/template/list\",\n                        \"name\":\"list\",\n                        \"meta\":{\n                            \"title\":\"列表\",\n                            \"icon\":\"el-icon-document\",\n                            \"type\":\"menu\"\n                        },\n                        \"children\":[\n                            {\n                                \"path\":\"/template/list/crud\",\n                                \"name\":\"listCrud\",\n                                \"meta\":{\n                                    \"title\":\"CRUD\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"template/list/crud\",\n                                \"children\":[\n                                    {\n                                        \"path\":\"/template/list/crud/detail/:id?\",\n                                        \"name\":\"listCrud-detail\",\n                                        \"meta\":{\n                                            \"title\":\"新增/编辑\",\n                                            \"hidden\":true,\n                                            \"active\":\"/template/list/crud\",\n                                            \"type\":\"menu\"\n                                        },\n                                        \"component\":\"template/list/crud/detail\"\n                                    }\n                                ]\n                            },\n                            {\n                                \"path\":\"/template/list/tree\",\n                                \"name\":\"listTree\",\n                                \"meta\":{\n                                    \"title\":\"左树右表\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"template/list/tree\"\n                            },\n                            {\n                                \"path\":\"/template/list/tab\",\n                                \"name\":\"listTab\",\n                                \"meta\":{\n                                    \"title\":\"分类表格\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"template/list/tab\"\n                            },\n                            {\n                                \"path\":\"/template/list/son\",\n                                \"name\":\"listSon\",\n                                \"meta\":{\n                                    \"title\":\"子母表\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"template/list/son\"\n                            },\n                            {\n                                \"path\":\"/template/list/widthlist\",\n                                \"name\":\"widthlist\",\n                                \"meta\":{\n                                    \"title\":\"定宽列表\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"template/list/width\"\n                            }\n                        ]\n                    },\n                    {\n                        \"path\":\"/template/other\",\n                        \"name\":\"other\",\n                        \"meta\":{\n                            \"title\":\"其他\",\n                            \"icon\":\"el-icon-folder\",\n                            \"type\":\"menu\"\n                        },\n                        \"children\":[\n                            {\n                                \"path\":\"/template/other/stepform\",\n                                \"name\":\"stepform\",\n                                \"meta\":{\n                                    \"title\":\"分步表单\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"template/other/stepform\"\n                            }\n                        ]\n                    }\n                ]\n            },\n            {\n                \"name\":\"other\",\n                \"path\":\"/other\",\n                \"meta\":{\n                    \"title\":\"其他\",\n                    \"icon\":\"el-icon-more-filled\",\n                    \"type\":\"menu\"\n                },\n                \"children\":[\n                    {\n                        \"path\":\"/other/directive\",\n                        \"name\":\"directive\",\n                        \"meta\":{\n                            \"title\":\"指令\",\n                            \"icon\":\"el-icon-price-tag\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"other/directive\"\n                    },\n                    {\n                        \"path\":\"/other/viewTags\",\n                        \"name\":\"viewTags\",\n                        \"meta\":{\n                            \"title\":\"标签操作\",\n                            \"icon\":\"el-icon-files\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"other/viewTags\",\n                        \"children\":[\n                            {\n                                \"path\":\"/other/fullpage\",\n                                \"name\":\"fullpage\",\n                                \"meta\":{\n                                    \"title\":\"整页路由\",\n                                    \"icon\":\"el-icon-monitor\",\n                                    \"fullpage\":true,\n                                    \"hidden\":true,\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"other/fullpage\"\n                            }\n                        ]\n                    },\n                    {\n                        \"path\":\"/other/verificate\",\n                        \"name\":\"verificate\",\n                        \"meta\":{\n                            \"title\":\"表单验证\",\n                            \"icon\":\"el-icon-open\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"other/verificate\"\n                    },\n                    {\n                        \"path\":\"/other/loadJS\",\n                        \"name\":\"loadJS\",\n                        \"meta\":{\n                            \"title\":\"异步加载JS\",\n                            \"icon\":\"el-icon-location-information\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"other/loadJS\"\n                    },\n                    {\n                        \"path\":\"/link\",\n                        \"name\":\"link\",\n                        \"meta\":{\n                            \"title\":\"外部链接\",\n                            \"icon\":\"el-icon-link\",\n                            \"type\":\"menu\"\n                        },\n                        \"children\":[\n                            {\n                                \"path\":\"https://baidu.com\",\n                                \"name\":\"百度\",\n                                \"meta\":{\n                                    \"title\":\"百度\",\n                                    \"type\":\"link\"\n                                }\n                            },\n                            {\n                                \"path\":\"https://www.google.cn\",\n                                \"name\":\"谷歌\",\n                                \"meta\":{\n                                    \"title\":\"谷歌\",\n                                    \"type\":\"link\"\n                                }\n                            }\n                        ]\n                    },\n                    {\n                        \"path\":\"/iframe\",\n                        \"name\":\"Iframe\",\n                        \"meta\":{\n                            \"title\":\"Iframe\",\n                            \"icon\":\"el-icon-position\",\n                            \"type\":\"menu\"\n                        },\n                        \"children\":[\n                            {\n                                \"path\":\"https://v3.cn.vuejs.org\",\n                                \"name\":\"vue3\",\n                                \"meta\":{\n                                    \"title\":\"VUE 3\",\n                                    \"type\":\"iframe\"\n                                }\n                            },\n                            {\n                                \"path\":\"https://element-plus.gitee.io\",\n                                \"name\":\"elementplus\",\n                                \"meta\":{\n                                    \"title\":\"Element Plus\",\n                                    \"type\":\"iframe\"\n                                }\n                            },\n                            {\n                                \"path\":\"https://lolicode.gitee.io/scui-doc\",\n                                \"name\":\"scuidoc\",\n                                \"meta\":{\n                                    \"title\":\"SCUI文档\",\n                                    \"type\":\"iframe\"\n                                }\n                            }\n                        ]\n                    }\n                ]\n            },\n            {\n                \"name\":\"test\",\n                \"path\":\"/test\",\n                \"meta\":{\n                    \"title\":\"实验室\",\n                    \"icon\":\"el-icon-mouse\",\n                    \"type\":\"menu\"\n                },\n                \"children\":[\n                    {\n                        \"path\":\"/test/autocode\",\n                        \"name\":\"autocode\",\n                        \"meta\":{\n                            \"title\":\"代码生成器\",\n                            \"icon\":\"sc-icon-code\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"test/autocode/index\",\n                        \"children\":[\n                            {\n                                \"path\":\"/test/autocode/table\",\n                                \"name\":\"autocode-table\",\n                                \"meta\":{\n                                    \"title\":\"CRUD代码生成\",\n                                    \"hidden\":true,\n                                    \"active\":\"/test/autocode\",\n                                    \"type\":\"menu\"\n                                },\n                                \"component\":\"test/autocode/table\"\n                            }\n                        ]\n                    },\n                    {\n                        \"path\":\"/test/codebug\",\n                        \"name\":\"codebug\",\n                        \"meta\":{\n                            \"title\":\"异常处理\",\n                            \"icon\":\"sc-icon-bug-line\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"test/codebug\"\n                    }\n                ]\n            },\n            {\n                \"name\":\"setting\",\n                \"path\":\"/setting\",\n                \"meta\":{\n                    \"title\":\"配置\",\n                    \"icon\":\"el-icon-setting\",\n                    \"type\":\"menu\"\n                },\n                \"children\":[\n                    {\n                        \"path\":\"/setting/system\",\n                        \"name\":\"system\",\n                        \"meta\":{\n                            \"title\":\"系统设置\",\n                            \"icon\":\"el-icon-tools\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"setting/system\"\n                    },\n                    {\n                        \"path\":\"/setting/user\",\n                        \"name\":\"user\",\n                        \"meta\":{\n                            \"title\":\"用户管理\",\n                            \"icon\":\"el-icon-user-filled\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"setting/user\"\n                    },\n                    {\n                        \"path\":\"/setting/role\",\n                        \"name\":\"role\",\n                        \"meta\":{\n                            \"title\":\"角色管理\",\n                            \"icon\":\"el-icon-notebook\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"setting/role\"\n                    },\n                    {\n                        \"path\":\"/setting/dept\",\n                        \"name\":\"dept\",\n                        \"meta\":{\n                            \"title\":\"部门管理\",\n                            \"icon\":\"sc-icon-organization\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"setting/dept\"\n                    },\n                    {\n                        \"path\":\"/setting/dic\",\n                        \"name\":\"dic\",\n                        \"meta\":{\n                            \"title\":\"字典管理\",\n                            \"icon\":\"el-icon-document\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"setting/dic\"\n                    },\n                    {\n                        \"path\":\"/setting/table\",\n                        \"name\":\"tableSetting\",\n                        \"meta\":{\n                            \"title\":\"表格列管理\",\n                            \"icon\":\"el-icon-scale-to-original\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"setting/table\"\n                    },\n                    {\n                        \"path\":\"/setting/menu\",\n                        \"name\":\"settingMenu\",\n                        \"meta\":{\n                            \"title\":\"菜单管理\",\n                            \"icon\":\"el-icon-fold\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"setting/menu\"\n                    },\n                    {\n                        \"path\":\"/setting/task\",\n                        \"name\":\"task\",\n                        \"meta\":{\n                            \"title\":\"计划任务\",\n                            \"icon\":\"el-icon-alarm-clock\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"setting/task\"\n                    },\n                    {\n                        \"path\":\"/setting/client\",\n                        \"name\":\"client\",\n                        \"meta\":{\n                            \"title\":\"应用管理\",\n                            \"icon\":\"el-icon-help-filled\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"setting/client\"\n                    },\n                    {\n                        \"path\":\"/setting/log\",\n                        \"name\":\"log\",\n                        \"meta\":{\n                            \"title\":\"系统日志\",\n                            \"icon\":\"el-icon-warning\",\n                            \"type\":\"menu\"\n                        },\n                        \"component\":\"setting/log\"\n                    }\n                ]\n            },\n            {\n                \"path\":\"/other/about\",\n                \"name\":\"about\",\n                \"meta\":{\n                    \"title\":\"关于\",\n                    \"icon\":\"el-icon-info-filled\",\n                    \"type\":\"menu\"\n                },\n                \"component\":\"other/about\"\n            }\n        ],\n        \"permissions\":[\n            \"list.add\",\n            \"list.edit\",\n            \"list.delete\",\n            \"user.add\",\n            \"user.edit\",\n            \"user.delete\"\n        ]\n    },\n    \"message\":\"\"\n}"
	var mapMenu map[string]interface{}
	_ = json.Unmarshal([]byte(menu), &mapMenu)

	c.JSON(http.StatusOK, mapMenu)
}

func DeptList(c *gin.Context) {
	data := "{\"code\":200,\"data\":[{\"id\":\"1\",\"parentId\":\"0\",\"label\":\"华南分部\",\"date\":\"2022-10-10 08:00:00\",\"remark\":\"\",\"status\":1,\"sort\":1,\"children\":[{\"id\":\"11\",\"parentId\":\"1\",\"label\":\"售前客服部\",\"date\":\"2022-10-10 08:00:00\",\"remark\":\"\",\"status\":1,\"sort\":2},{\"id\":\"12\",\"parentId\":\"1\",\"label\":\"技术研发部\",\"date\":\"2022-10-10 08:00:00\",\"remark\":\"软件开发&测试\",\"status\":0,\"sort\":3}]},{\"id\":\"2\",\"parentId\":\"0\",\"label\":\"华东分部\",\"date\":\"2022-10-10 08:00:00\",\"remark\":\"\",\"status\":1,\"sort\":4,\"children\":[{\"id\":\"21\",\"parentId\":\"2\",\"label\":\"售前客服部\",\"date\":\"2022-10-10 08:00:00\",\"remark\":\"\",\"status\":1,\"sort\":5},{\"id\":\"22\",\"parentId\":\"2\",\"label\":\"技术研发部\",\"date\":\"2022-10-10 08:00:00\",\"remark\":\"\",\"status\":1,\"sort\":6}]}],\"message\":\"\"}"

	var dataMap map[string]interface{}
	_ = json.Unmarshal([]byte(data), &dataMap)
	c.JSON(http.StatusOK, dataMap)
}

func DemoUser(c *gin.Context) {
	user := "{\"code\":200,\"data\":{\"total\":41,\"rows\":[{\"id\":\"410000199512025445\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"GET\",\"code\":\"401\",\"cip\":\"95.214.92.71\",\"user\":\"魏磊\",\"time\":\"2012-09-05 18:08:06\"},{\"id\":\"520000198407304275\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"GET\",\"code\":\"500\",\"cip\":\"129.166.168.115\",\"user\":\"史平\",\"time\":\"1993-08-25 05:08:41\"},{\"id\":\"230000199511014097\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"GET\",\"code\":\"200\",\"cip\":\"186.160.119.210\",\"user\":\"于杰\",\"time\":\"1998-02-09 13:42:41\"},{\"id\":\"990000197205236780\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"POST\",\"code\":\"401\",\"cip\":\"193.14.94.222\",\"user\":\"田娟\",\"time\":\"2009-11-05 12:37:58\"},{\"id\":\"640000200911201176\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"GET\",\"code\":\"500\",\"cip\":\"12.69.226.121\",\"user\":\"邵涛\",\"time\":\"1989-08-25 05:33:06\"},{\"id\":\"710000198709077149\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"GET\",\"code\":\"500\",\"cip\":\"116.42.15.149\",\"user\":\"魏娟\",\"time\":\"2008-09-07 10:35:41\"},{\"id\":\"360000197302144442\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"GET\",\"code\":\"500\",\"cip\":\"239.114.89.252\",\"user\":\"何敏\",\"time\":\"2016-07-14 20:41:53\"},{\"id\":\"500000199407048831\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"GET\",\"code\":\"401\",\"cip\":\"95.203.182.52\",\"user\":\"傅刚\",\"time\":\"1995-03-09 23:53:50\"},{\"id\":\"450000198307033289\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"GET\",\"code\":\"500\",\"cip\":\"60.137.195.112\",\"user\":\"康伟\",\"time\":\"1970-01-13 19:18:19\"},{\"id\":\"220000200908305857\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"POST\",\"code\":\"500\",\"cip\":\"106.167.1.227\",\"user\":\"何秀英\",\"time\":\"1976-01-01 14:27:22\"},{\"id\":\"450000201411302578\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"GET\",\"code\":\"401\",\"cip\":\"241.235.41.98\",\"user\":\"吴涛\",\"time\":\"2003-10-22 18:03:07\"},{\"id\":\"81000020100227047X\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"GET\",\"code\":\"200\",\"cip\":\"120.218.167.233\",\"user\":\"毛军\",\"time\":\"1983-12-27 22:13:35\"},{\"id\":\"420000198411242296\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"GET\",\"code\":\"500\",\"cip\":\"123.130.209.70\",\"user\":\"张霞\",\"time\":\"2008-06-17 01:36:50\"},{\"id\":\"460000201605269026\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"POST\",\"code\":\"500\",\"cip\":\"79.243.107.181\",\"user\":\"段超\",\"time\":\"1980-01-16 19:59:55\"},{\"id\":\"610000200506056280\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"POST\",\"code\":\"200\",\"cip\":\"14.23.92.219\",\"user\":\"宋涛\",\"time\":\"1986-10-19 11:28:05\"},{\"id\":\"370000197405268159\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"POST\",\"code\":\"500\",\"cip\":\"233.81.94.91\",\"user\":\"石勇\",\"time\":\"2012-04-29 21:58:34\"},{\"id\":\"440000200407105727\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"POST\",\"code\":\"200\",\"cip\":\"178.29.69.222\",\"user\":\"贾超\",\"time\":\"1989-09-28 16:26:08\"},{\"id\":\"45000019760731722X\",\"name\":\"用户登录\",\"url\":\"/oauth/token\",\"type\":\"GET\",\"code\":\"500\",\"cip\":\"117.35.28.120\",\"user\":\"汤强\",\"time\":\"1975-05-24 14:29:46\"}]},\"message\":\"\"}"
	var userMap map[string]interface{}
	_ = json.Unmarshal([]byte(user), &userMap)
	c.JSON(http.StatusOK, userMap)

}
